package de.baumann.browser.api.net;

import java.util.List;

import de.baumann.browser.api.net.base.BaseUrl;
import de.baumann.browser.api.net.vo.PacketDetail;
import de.baumann.browser.api.net.vo.PacketMark;
import de.baumann.browser.api.net.vo.PacketRecord;
import de.baumann.browser.api.net.vo.PacketStatus;
import de.baumann.browser.api.net.vo.Result;
import io.reactivex.Observable;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;

@BaseUrl(ApiKey.PACKET)
public interface PackApiService {

    @FormUrlEncoded
    @POST("addRedPacket")
    Observable<Result> sendPack(
            @Field("description") String description,
            @Field("imgUrl") String imgUrl,
            @Field("packetAmount") int packetAmount,
            @Field("totalCount") int totalCount,
            @Field("adUrl") String adUrl,
            @Field("packetLocation") String packetLocation);


    @POST("reList")
    Observable<Result<PacketRecord>> getRecivedPacks();

    @POST("reSendList")
    Observable<Result<PacketRecord>> getSendPacks();

    @FormUrlEncoded
    @POST("queryPacket")
    Observable<Result<List<PacketMark>>> getPackets(@Field("packetLocation") String packetLocation);

    @FormUrlEncoded
    @POST("queryPacket1")
    Observable<Result<PacketMark>> getPackets1(@Field("userId") String userId,
                                               @Field("packetLocation") String packetLocation,
                                               @Field("vaptchaToken")String token);

    @FormUrlEncoded
    @POST("getPacket")
    Observable<Result<PacketStatus>> getPacketStatus(@Field("packetId") Integer packetId);

    @FormUrlEncoded
    @POST("rePacket")
    Observable<Result<PacketStatus>> rePacket(@Field("packetId") Integer packetId);

    @FormUrlEncoded
    @POST("details")
    Observable<Result<PacketDetail>> details(@Field("packetId") Integer packetId);
}
